package com.ruoyi.slope.data.fencenet.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.slope.data.fencenet.mapper.SlopeFencenetDataMapper;
import com.ruoyi.slope.data.fencenet.domain.SlopeFencenetData;
import com.ruoyi.slope.data.fencenet.service.ISlopeFencenetDataService;

/**
 * 边坡防护网监测数据Service业务层处理
 * 
 * @author ruoyi
 * @date 2025-05-19
 */
@Service
public class SlopeFencenetDataServiceImpl implements ISlopeFencenetDataService 
{
    @Autowired
    private SlopeFencenetDataMapper slopeFencenetDataMapper;

    /**
     * 获取最新防护倾角数据
     */
    @Override
    public SlopeFencenetData getLatestFencenetTilt(String deviceSn) {
        return slopeFencenetDataMapper.selectLatestFencenetTilt(deviceSn);
    }

    /**
     * 获取最新防护加速度数据
     */
    @Override
    public SlopeFencenetData getLatestFencenetAcceleration(String deviceSn) {
        return slopeFencenetDataMapper.selectLatestFencenetAcceleration(deviceSn);
    }

    public void scanned(){
        slopeFencenetDataMapper.scanned();
    }

    public List<SlopeFencenetData> warningSelectSlopeFencenetDataList(SlopeFencenetData slopeFencenetData){
        return slopeFencenetDataMapper.warningSelectSlopeFencenetDataList(slopeFencenetData);
    }

    /**
     * 查询边坡防护网监测数据
     * 
     * @param id 边坡防护网监测数据主键
     * @return 边坡防护网监测数据
     */
    @Override
    public SlopeFencenetData selectSlopeFencenetDataById(Long id)
    {
        return slopeFencenetDataMapper.selectSlopeFencenetDataById(id);
    }

    /**
     * 查询边坡防护网监测数据列表
     * 
     * @param slopeFencenetData 边坡防护网监测数据
     * @return 边坡防护网监测数据
     */
    @Override
    public List<SlopeFencenetData> selectSlopeFencenetDataList(SlopeFencenetData slopeFencenetData)
    {
        return slopeFencenetDataMapper.selectSlopeFencenetDataList(slopeFencenetData);
    }

    /**
     * 新增边坡防护网监测数据
     * 
     * @param slopeFencenetData 边坡防护网监测数据
     * @return 结果
     */
    @Override
    public int insertSlopeFencenetData(SlopeFencenetData slopeFencenetData)
    {
        slopeFencenetData.setCreateTime(DateUtils.getNowDate());
        return slopeFencenetDataMapper.insertSlopeFencenetData(slopeFencenetData);
    }

    /**
     * 修改边坡防护网监测数据
     * 
     * @param slopeFencenetData 边坡防护网监测数据
     * @return 结果
     */
    @Override
    public int updateSlopeFencenetData(SlopeFencenetData slopeFencenetData)
    {
        slopeFencenetData.setUpdateTime(DateUtils.getNowDate());
        return slopeFencenetDataMapper.updateSlopeFencenetData(slopeFencenetData);
    }

    /**
     * 批量删除边坡防护网监测数据
     * 
     * @param ids 需要删除的边坡防护网监测数据主键
     * @return 结果
     */
    @Override
    public int deleteSlopeFencenetDataByIds(Long[] ids)
    {
        return slopeFencenetDataMapper.deleteSlopeFencenetDataByIds(ids);
    }

    /**
     * 删除边坡防护网监测数据信息
     * 
     * @param id 边坡防护网监测数据主键
     * @return 结果
     */
    @Override
    public int deleteSlopeFencenetDataById(Long id)
    {
        return slopeFencenetDataMapper.deleteSlopeFencenetDataById(id);
    }
}
